<%@page import="lib_model.Product.Image_products"%>
<%@page import="java.util.ArrayList"%>
<%@page import="lib_model.Product.Products"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="UTF-8"%>
<jsp:include page="../templates/Header.jsp"></jsp:include>
Product
<jsp:include page="../templates/Title.jsp"></jsp:include>
<jsp:include page="../templates/Style.jsp"></jsp:include>
<div class="body-center w960">
<%
	if (request.getParameter("id") != null) {%>
	 <h2 class="title-show">Shop By Category</h2><%
		String idCategories = request.getParameter("id").toString();
		Products p = new Products();
		ArrayList<Products> ps = (ArrayList<Products>) p.Select().ObjResult;
		for (Products product : ps) {
			if (product.categories_id_ref == (Integer
					.parseInt(idCategories))) {
%>

<div class="product-show"
	style="padding: 3px; border: 2px solid; font-size: 12px">
<div style="width: 90%; margin: 4px;background-color: #ECC900;padding: 3px;-moz-border-radius:5px"	>
<b>Name</b>:
<font color="white"><%=product.name%></font><br>

<b>Price</b> : <font color="white"><%=product.price%></font> $<br>
<div class="clear"></div>
</div>
<br>
<%
	Image_products img = new Image_products();
				ArrayList<Image_products> imgs = (ArrayList<Image_products>) img
						.Select(product.id).ObjResult;
				for (Image_products img2 : imgs) {
%> <a href="../pages/product-detail.jsp?id=<%=product.id%>"><img
	style="border: 1px solid;" src="../uploads/<%=img2.image_url%>"
	alt="Product Image.." height="175" width="175" /></a> <%
 	break;
 				}
 %>
<hr />
</div>
<%
	}
		}
	} else {
%><h2>This Categories is empty</h2>
<%
	}
%>
</div>
<jsp:include page="../templates/Footer.jsp"></jsp:include>